#pragma once

const int MAXBUFSIZE = 1024;


struct myfile
{
    int fd;
    char buf[MAXBUFSIZE];
    int size;
    int cap;
};


typedef struct myfile mfile;

mfile* mopen(const char* path, const char* mode);

size_t mwrite(mfile* f, const char* buf, int len);

int mfflush(mfile* f);

int mclose(mfile* f);